package com.lulalei.dbviewer.commons.api;

import javax.validation.constraints.Min;

public class PageBean {

    @Min(value = 0, message = "请输入正确的页码")
    private Integer page;

    @Min(value = 0, message = "请输入正确的页大小")
    private Integer pageSize;

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        if (page == null) {
            this.page = 1;
        } else {
            this.page = page;
        }
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        if (pageSize == null) {
            this.pageSize = 10;
        } else {
            this.pageSize = pageSize;
        }
    }
}
